//
//  BSBottomView.m
//  BaiSi
//
//  Created by Sycamore on 16/5/4.
//  Copyright © 2016年 Sycamore. All rights reserved.
//

#import "BSBottomView.h"
#import "BSThemeItem.h"

@interface BSBottomView ()
@property (weak, nonatomic) IBOutlet UIButton *Cai;

@property (weak, nonatomic) IBOutlet UIButton *Ding;

@property (weak, nonatomic) IBOutlet UIButton *Share;
@property (weak, nonatomic) IBOutlet UIButton *Comment;

@end

@implementation BSBottomView

- (void)setItem:(BSThemeItem *)item
{
    [super setItem:item];
    
    [_Cai setTitle:[self resolveString:item.cai] forState:UIControlStateNormal];
    [_Ding setTitle:[self resolveString:item.ding]forState:UIControlStateNormal];

    [_Share setTitle:[self resolveString:item.repost] forState:UIControlStateNormal];

    [_Comment setTitle:[self resolveString:item.comment] forState:UIControlStateNormal];

    
    
}

- (NSString *)resolveString:(NSString *)string
{
    NSInteger number = [string integerValue];
    
    if (number > 10000) {
        string = [NSString stringWithFormat:@"%.1f", number/10000.0 ];
        string = [string stringByReplacingOccurrencesOfString:@".0" withString:@""];
    }
    
    return string;
}

@end
